/*	有1元.2元.5元人民币,问有多少种可能可以凑出10元.每种人民币没有个数限制
 *
 */

#include<stdio.h>

// 我的算法.枚举.一共运行10*5*2=100次
/*
int main() {
	int way = 0;
	for (int money1 = 0; money1 <= 10; money1++) {
		for (int money2 = 0; money2 <= 5; money2++) {
			for (int money5 = 0; money5 <= 2; money5++) {
				if (money1 * 1 + money2 * 2 + money5 * 5 == 10) {
					if (money1 != 0) {
						printf("1元%d个.", money1);
					}
					if (money2 != 0) {
						printf("2元%d个.", money2);
					}
					if (money5 != 0) {
						printf("5元%d个.", money5);
					}
					printf("\n");	
					way++;
				}
			}
		}
	}
	printf("共有%d种可能\n", way);
	return 0;
}
*/

//老师算法,声明5元的个数为num,2元的个数为num1
int main() {
	int num = 0, num1 = 0, way = 0;
	for (num = 0; num <= 2; num++) {
		for (num1 = 0; num1 <= 10 - num * 5; num1++) {
			if (num * 5 + num1 * 2 <= 10) {
				printf("1元%d张,2元%d张,5元%d张\n",10 - 5 * num - 2 * num1, num1, num);
				way++;
			}
		}
	}
	printf("有%d种可能\n", way);
	return 0;
}
